package org.flexthinker.binding.value.support
{
    import org.flexthinker.binding.value.PropertyChangeListener;

    import mx.events.PropertyChangeEvent;

    /**
     *  Delegates the propertyChange method call to another method.
     */
    public class DelegatingPropertyChangeListener implements PropertyChangeListener
    {
        private var callback:Function;
        public function DelegatingPropertyChangeListener( callback:Function ):void
        {
            this.callback = callback;
        }

        public function propertyChange( event:PropertyChangeEvent ):void
        {
            if ( callback != null)
            {
                callback( event );
            }
        }
    }
}